'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  
  //登陆
  router.post('/user/login',controller.login.login);
  //用户信息
  router.get('/user/info',controller.user.userinfo);
  //登出
  router.post('/user/logout',controller.login.logout);
  //插入区域
  router.post('/table/insertArea',controller.table.area.createArea);
  //获取区域列表
  router.get('/table/list',controller.table.area.getAreaList);
  //删除区域
  router.post('/table/deleteArea',controller.table.area.deleteArea);
  //添加餐桌
  router.post('/table/createTable', controller.table.table.createTable);
  //按区域划分餐桌列表
  router.get('/table/tableListByArea', controller.table.table.getTables);
  //删除餐桌
  router.post('/table/deleteById',controller.table.table.deleteTableById);
  //获取图片上传token
  router.get('/util/getToken',controller.util.token.getToken);
  //创建菜品
  router.post('/dish/create',controller.dish.dish.createDish);
  //获取菜单配置页数据
  router.get('/dish/configList',controller.dish.dish.getDishList);
  //修改菜品上架状态
  router.post('/dish/changeStatus',controller.dish.dish.changeSellStatus);
  //删除菜品
  router.post('/dish/delete',controller.dish.dish.deleteDish);
  //查询上架菜品列表
  router.post('/dish/onsale',controller.dish.dish.getOnSaleList);
  //登陆页查询餐厅列表
  router.post('/login/restList',controller.login.getRestaurant);
  //修改菜品单价
  router.post('/dish/changePrice',controller.dish.dish.changePrice);
  //未支付订单列表
  router.get('/order/unpayList',controller.order.order.unpayList);
  //修改订单支付状态
  router.post('/order/settle',controller.order.order.settleOrder);
  //首页餐桌状态
  router.get('/dash/tablestatus',controller.dashboard.dashboard.tablestatus);
};
